<script type="text/javascript" src="/app/admin/static/components/area/cascade.js"></script>
<style type='text/css'>
    .select-group {height: 28px;padding-top:2px;}
</style>
<form class="form-horizontal form-validate" action="{:webUrl('web.order.op/changeaddress')}" method="post" enctype="multipart/form-data">
	<input type='hidden' name='id' value='{$id}' />

	<div class="modal-dialog">
           <div class="modal-content">
            <div class="modal-header">
                <button data-dismiss="modal" class="close" type="button">×</button>
                <h4 class="modal-title">编辑收货信息</h4>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    <label class="col-sm-2 control-label">收货人 :</label>
                    <div class="col-sm-9 col-xs-12">
                        <input type="text" name="realname" class="form-control" value="{$user['realname']}" data-rule-required='true' />
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">手机 :</label>
                    <div class="col-sm-9 col-xs-12">
                        <input type="text" name="mobile" class="form-control" value="{$user['mobile']}" data-rule-required='true' />
                    </div>
                </div>

                <div class="form-group dispatch_info">
                    <label class="col-sm-2 control-label">修改地址 :</label>
                    <div class="col-sm-9 col-xs-12">
                        <label class="radio-inline"><input type="radio" name="changead" value="0" checked="true"/> 否</label>
                        <label class="radio-inline"><input type="radio" name="changead" value="1" /> 是</label>
                        <span class="help-block"></span>
                    </div>
                </div>

                <div class="form-group ad-group"  style="display: none;">
                    <label class="col-sm-2 control-label">地址 :</label>
                    <div class="col-sm-9 col-xs-12">
                        <span class="help-block">{$user['address']}</span>
                    </div>
                </div>

                <div class="form-group ad-group" style="display: none;">
                    <label class="col-sm-2 control-label">新地址 :</label>
                    <div class="col-sm-9 col-xs-12">
                        <p>
                            <select id="sel-provance" name="province" onChange="selectCity();" class="select form-control select-group" style="width:123px;display:inline;">
                                <option value="" selected="true">省/直辖市</option>
                            </select>
                            <select id="sel-city" name="city" onChange="selectcounty(0)" class="select form-control select-group" style="width:135px;display:inline;">
                                <option value="" selected="true">请选择</option>
                            </select>
                            <select id="sel-area" name="area" onChange="selectstreet(0)" class="select form-control select-group" style="width:130px;display:inline;">
                                <option value="" selected="true">请选择</option>
                            </select>

                            {if !empty($new_area) && !empty($address_street)}
                            <select id="sel-street" name="street" class="select form-control select-group" style="width:220px;display:inline;margin-top: 10px;">
                                <option value="" selected="true">请选择</option>
                            </select>
                            {/if}
                        </p>
                        <input type="text" name="address" class="form-control" value="{$address_info}" data-rule-required='true' />
                    </div>
                </div>


            </div>
            <div class="modal-footer">
                <button class="btn btn-primary" type="submit">保存</button>
                <button data-dismiss="modal" class="btn btn-default" type="button">取消</button>
            </div>
        </div>
        </div>
</form>
<script language="javascript">
    $(function () {
        $(':radio[name=changead]').click(function () {
            var type = $("input[name='changead']:checked").val();
            if (type == '1') {
                $('.ad-group').show();
            } else {
                $('.ad-group').hide();
            }
        });
    });

    cascdeInit("0","0","{:isset($user['province'])?$user['province']:''}","{:isset($user['city'])?$user['city']:''}","{:isset($user['area'])?$user['area']:''}","{:isset($user['street'])?$user['street']:''}");
</script>



